var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var app = express();

global.secret = '64c3f323387c3bb0cfa11842799cba3a';
global.appid = 'wxbcead34b05b01e45';
global.initUrl=__dirname

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser('aaa'));
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', indexRouter);
app.use('/api', require('./routes/login/login'))
app.use('/dynamic', require('./routes/dynamic'))
app.use('/notice',require('./routes/notice'))

module.exports = app;
